package com.kaibes.test.controller;

import java.util.List;

import com.kaibes.object.BesObjectContext;
import com.kaibes.object.annotation.BesResource;
import com.kaibes.test.data.UserData;

public class Controller {

	@BesResource
	private List<UserData> userDatas;
	@BesResource("userDatas")
	private List<UserData> userDatas2;

	public Controller() {
		//注入数据，这个可以被AOP技术替换掉
		BesObjectContext.initValue(this);
	}
	
	public void say() {
		System.out.println("hello world!" + userDatas.get(0).getUsername());
		System.out.println("hello world!" + userDatas.get(1).getUsername());
		System.out.println("hello world!" + userDatas.get(0).getPassword());
		System.out.println("hello world!" + userDatas.get(1).getPassword());
	}
	
	public String getHello() {
		return "hello "+userDatas.get(0).getUsername();
	}

}
